import request from '@/utils/request'

// 1、 方案1：不新建表了直接复用字典表：字典项查询时做过滤  2、方案2：建表，设置deptId来控制相关数据权限
// TODO 暂用方案1
// 查询列表
export function list(query = {}) {
  query.dictType = "web_cate";
  return request({
    url: '/system/dict/data/list',
    method: 'get',
    params: query
  })
}

// 新增 {"dictLabel":"1","dictValue":"1","listClass":"default","dictSort":0,"status":"0","dictType":"web_cate"}
export function add(data) {
  data.dictType = "web_cate";
  return request({
    url: '/system/dict/data',
    method: 'post',
    data
  })
}

// 修改
export function update(data) {
  data.dictType = "web_cate";
  return request({
    url: '/system/dict/data',
    method: 'put',
    data
  })
}

// 删除
export function del(dictCode) {
  return request({
    url: '/system/dict/data/' + dictCode,
    method: 'delete'
  })
}
